// Press Shift twice to open the Search Everywhere dialog and type `show whitespaces`,
// then press Enter. You can now see whitespace characters in your code.
//public class Main {
//    public static void main(String[] args) {
//        //任务一
//        String str= "HelloWorld";
//        StringBuffer ret=new StringBuffer();
//        for(int i=str.length()-1;i>=0;i--)
//        {
//            if(str.charAt(i)>='a' && str.charAt(i)<='z')
//                ret.append(String.valueOf(str.charAt(i)).toUpperCase());
//            else
//                ret.append(String.valueOf(str.charAt(i)).toLowerCase());
//        }
//        System.out.println(ret.toString());
//    }
//}

//import java.lang.reflect.Array;
//import java.util.Arrays;
//
//public class Main{
//    public static void main(String[] args) {
//        int[] arr1=new int[]{1,2,3,4,5,6,7,8,9,10};
//        int[] arr2=new int[10];
//        System.arraycopy(arr1,2,arr2,2,4);
//        System.out.println("arr1:"+Arrays.toString(arr1));
//        System.out.println("arr2:"+Arrays.toString(arr2));
//
//    }
//}

import java.util.Scanner;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) {
        int cnt=0;
        int sum=0;
        String str="糖醋排骨：46元；清蒸鲑鱼：52元；蚂蚁上树：25元；凉拌海蜇头：38元";
        StringTokenizer stringTokenizer=new StringTokenizer(str,"；");
        while(stringTokenizer.hasMoreElements())
        {
            cnt++;
            String part=stringTokenizer.nextToken();
            String[] tmp=part.split("：");
            String[] price=tmp[1].split("元");
            sum+=Integer.valueOf(price[0]);
        }
        System.out.println("一共有"+cnt+"种菜");
        System.out.println("一共"+sum+"元");
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入你付的钱：");
        int cost=sc.nextInt();
        System.out.println("找零："+(cost-sum)+"元");
    }
}